﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommunergyUploader;
using Communergy.Common;

namespace Communergy.Repository
{
    public class UploadWeatherWCFAndCommunergy : IRealtimeRepository , IHistoricRepository
    {
        CurrentCostUploadToWeatherWCF weatherWCF = new CurrentCostUploadToWeatherWCF();
        CommunergyUpload communergyUpload = new CommunergyUpload();
      

        #region IRealtimeRepository Members

        public void Insert_ElectricityRealtime(string meterId, List<RealtimeEnergyReading> realtimeEnergyReadings)
        {
            weatherWCF.Insert_ElectricityRealtime(meterId, realtimeEnergyReadings);
            communergyUpload.Insert_ElectricityRealtime(meterId, realtimeEnergyReadings);
        }

        public List<RealtimeEnergyReading> Get_ElectricityRealtime(string meterId, DateTime dateFrom, DateTime dateTo)
        {
            throw new NotImplementedException();
        }




        public RealtimeEnergyReading GetLastElectricityRealtime(string meterId)
        {
            var realtime = communergyUpload.GetLastElectricityRealtime(meterId);
            return realtime;
        }

        #endregion

        #region IHistoricRepository Members

        public void Insert_ElectricityHourly(string meterId, List<HistoricalEnergyReading> hourlyEnergyReadings)
        {
            communergyUpload.Insert_ElectricityHourly(meterId, hourlyEnergyReadings);
        }

        public void Insert_ElectricityDaily(string meterId, List<HistoricalEnergyReading> dailyEnergyReadings)
        {
            communergyUpload.Insert_ElectricityDaily(meterId, dailyEnergyReadings);
        }

        public void Insert_ElectricityMonthly(string meterId, List<HistoricalEnergyReading> monthlyEnergyReadings)
        {
            communergyUpload.Insert_ElectricityMonthly(meterId, monthlyEnergyReadings);
        }

        #endregion



        #region IHistoricRepository Members


        public List<HistoricalEnergyReading> GetHourly(string meterId, DateTime dateFrom)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region IRealtimeRepository Members


        public HistoricalEnergyReading GetCumulativeElectricityRealtime(string meterId, DateTime dateFrom, DateTime dateTo)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
